package com.lzx.iteam.util;

import android.graphics.Bitmap;

import com.lzx.iteam.DialerApp;
import com.lzx.iteam.R;
import io.rong.imageloader.core.DisplayImageOptions;
import io.rong.imageloader.core.ImageLoader;
import io.rong.imageloader.core.assist.ImageScaleType;
import io.rong.imageloader.core.display.FadeInBitmapDisplayer;
import io.rong.imageloader.core.display.RoundedBitmapDisplayer;

public interface ImageLoaderInterface {

	ImageLoader imageLoader = ImageLoader.getInstance();


	DisplayImageOptions optionHeadImage = new DisplayImageOptions.Builder()
	//.showStubImage(R.drawable.default_cloud_image)
	.showImageForEmptyUri(R.drawable.default_cloud_image)
	.showImageOnFail(R.drawable.default_cloud_image)
	.cacheInMemory(true)
	.cacheOnDisc(true)
	.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
	.bitmapConfig(Bitmap.Config.RGB_565)
	.build();


	DisplayImageOptions optionChatImage = new DisplayImageOptions.Builder()
			//.showStubImage(R.drawable.default_cloud_image)
			.showImageForEmptyUri(R.drawable.default_cloud_image)
			.showImageOnFail(R.drawable.default_cloud_image)
			.cacheInMemory(true)
			.cacheOnDisc(true)
			.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
			.bitmapConfig(Bitmap.Config.RGB_565)
			.build();

	DisplayImageOptions optionEventImage = new DisplayImageOptions.Builder()
			//.showStubImage(R.drawable.loading_gallery)
			.showImageForEmptyUri(R.drawable.loading_gallery)
			.showImageOnFail(R.drawable.loading_gallery)
			.cacheInMemory(true)
			.cacheOnDisc(true)
			.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
			.bitmapConfig(Bitmap.Config.RGB_565)
			.build();

	// 选择相册
	DisplayImageOptions optionGalleryImage = new DisplayImageOptions.Builder()
			.showStubImage(R.drawable.loading_gallery)
			.showImageForEmptyUri(R.drawable.loading_gallery)
			.showImageOnFail(R.drawable.loading_gallery)
			.cacheInMemory(true)
			.cacheOnDisc(true)
			.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
			.bitmapConfig(Bitmap.Config.RGB_565)
			.build();

	DisplayImageOptions optionChatIv = new DisplayImageOptions.Builder()
			.showStubImage(R.drawable.default_image)
			.showImageForEmptyUri(R.drawable.default_image)
			.showImageOnFail(R.drawable.default_image)
			.cacheInMemory(true)
			.cacheOnDisc(true)
			.displayer(new RoundedBitmapDisplayer(4)) // 圆角
			.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
			.bitmapConfig(Bitmap.Config.RGB_565)
			.build();
}
